import Vue from 'vue'
import App from './App.vue'
import router from './router'

Vue.config.productionTip = false

import { registerMicroApps, start } from 'qiankun'

registerMicroApps([
  {
    name: 'vueApp1',   //子应用的名字
    entry: process.env.NODE_ENV === 'development' ? '//localhost:4000' : '/vue1/',  // 子应用的路径
    container: '#container',  // 装载子应用的容器
    activeRule: process.env.NODE_ENV === 'development' ? '/#/vue1' : '/vue1/',  // 路由匹配
    props: {
      container: document.querySelector('#container')
    }
  },
  {
    name: 'vueApp2',
    entry: process.env.NODE_ENV === 'development' ? '//localhost:4100' : '/vue2/',
    container: '#container',
    activeRule: process.env.NODE_ENV === 'development' ? '/#/vue2' : '/vue2/',
    props: {
      container: document.querySelector('#container')
    }
  }
])
// 启动 qiankun
start()

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
